package com.github.wxpay.sdk.config;

import com.github.wxpay.sdk.entity.WXPayDomain;

public class WXPayConfig {
    //App ID
    private String appID;
    // 商户号	Mch ID
    private String mchID;
    //获取 API 密钥
    private String key;
    //获取商户证书内容
    private byte[] certStream;
    // HTTP(S) 连接超时时间，单位毫秒
    private int httpConnectTimeoutMs = 8000;
    // HTTP(S) 读数据超时时间，单位毫秒
    private int httpReadTimeoutMs = 10000;
    //获取WXPayDomain, 用于多域名容灾自动切换
    private WXPayDomain wxPayDomain = new WXPayDomain();

    // 健康上报缓存消息的最大数量。会有线程去独立上报
    // 粗略计算：加入一条消息200B，10000消息占用空间 2000 KB，约为2MB，可以接受
    private int reportQueueMaxSize = 10000;
    //进行健康上报的线程的数量
    private int reportWorkerNum = 6;
    //是否自动上报。若要关闭自动上报，子类中实现该函数返回 false 即可。
    private boolean autoReport = true;
    //批量上报，一次最多上报多个数据
    private int reportBatchSize = 10;

    public int getReportBatchSize() {
        return reportBatchSize;
    }

    public void setReportBatchSize(int reportBatchSize) {
        this.reportBatchSize = reportBatchSize;
    }

    public boolean isAutoReport() {
        return autoReport;
    }

    public void setAutoReport(boolean autoReport) {
        this.autoReport = autoReport;
    }

    public String getAppID() {
        return appID;
    }

    public void setAppID(String appID) {
        this.appID = appID;
    }

    public String getMchID() {
        return mchID;
    }

    public void setMchID(String mchID) {
        this.mchID = mchID;
    }

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public byte[] getCertStream() {
        return certStream;
    }

    public void setCertStream(byte[] certStream) {
        this.certStream = certStream;
    }

    public WXPayDomain getWxPayDomain() {
        return wxPayDomain;
    }

    public void setWxPayDomain(WXPayDomain wxPayDomain) {
        this.wxPayDomain = wxPayDomain;
    }

    public int getHttpConnectTimeoutMs() {
        return httpConnectTimeoutMs;
    }

    public void setHttpConnectTimeoutMs(int httpConnectTimeoutMs) {
        this.httpConnectTimeoutMs = httpConnectTimeoutMs;
    }

    public int getHttpReadTimeoutMs() {
        return httpReadTimeoutMs;
    }

    public void setHttpReadTimeoutMs(int httpReadTimeoutMs) {
        this.httpReadTimeoutMs = httpReadTimeoutMs;
    }


    public int getReportQueueMaxSize() {
        return reportQueueMaxSize;
    }

    public void setReportQueueMaxSize(int reportQueueMaxSize) {
        this.reportQueueMaxSize = reportQueueMaxSize;
    }

    public int getReportWorkerNum() {
        return reportWorkerNum;
    }

    public void setReportWorkerNum(int reportWorkerNum) {
        this.reportWorkerNum = reportWorkerNum;
    }
}
